package com.examples.calendar.viewer.item;

import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;

/**
 * Filter on Holiday dates to display only holidays in calendar.
 * @author ryada9
 *
 */
public class CalendarHolidayFilter extends ViewerFilter {

	@Override
	public boolean select(Viewer viewer, Object parentElement, Object element) {
		CalendarItem data = (CalendarItem) element;

		if (Integer.parseInt(data.getText()) == 7
				|| Integer.parseInt(data.getText()) == 14
				|| Integer.parseInt(data.getText()) == 21) {
			System.out.println("filter called");
			return true;
		}
		return false;
	}

}
